#include "exercisee_spi_dianweiqi.h"
#include "timer_1_motor.h"

void exercisee_spi_dianweiqi_test()
{
    timer_1_motor_config();
    adc_dianweiqi_config();

    OLED_Init_SPI_HARD();
    char str[] = "Abc";
    uint8_t duty = 0;
    while (1)
    {
        // OLED_Clear();
        str[1] = str[1]++;
        if (str[1] >= 'z')
        {
            str[1] = 'A';
        }
        OLED_ShowString_SPI_HARD(0, 0, (uint8_t *)str, 16, 1);
        duty = (uint8_t)(adc_dianweiqi_get() * 100);
        OLED_ShowNum_SPI_HARD(0, 16, duty, 3, 16, 1);
        OLED_Refresh_SPI_HARD();

        //
        timer_1_motor_set(adc_dianweiqi_get());

        delay_1ms(1000);
    }
}
